package org.geeks.gsjetcache.conf;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.DependsOn;

import com.alicp.jetcache.anno.config.EnableMethodCache;
import com.alicp.jetcache.autoconfigure.LettuceFactory;
import com.alicp.jetcache.autoconfigure.RedisLettuceAutoConfiguration;

import io.lettuce.core.RedisClient;

@Configuration
@EnableMethodCache(basePackages = "org.geeks.gsjetcache")
public class JetcacheConfig {

	@Bean(name = "defaultClient")
	@DependsOn(RedisLettuceAutoConfiguration.AUTO_INIT_BEAN_NAME)
	public LettuceFactory defaultClient() {
		return new LettuceFactory("remote.default", RedisClient.class);
	}
}
